/* 
 * Gneat (http://gneat.org)
 *
 * (C) Copyright 2011 and beyond - Claudio Stella, all rights reserved.
 *
 * This file is part of Gneat.
 *
 * Gneat is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License (LGPL)
 * as published by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Gneat is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * and the GNU General Public License, for completeness, along with Gneat.  
 * If not, see <http://www.gnu.org/licenses/>.
 */
package com.google.gwt.user.client.impl;

import com.google.gwt.user.client.Element;

class GneatDOMImplWebKit extends DOMImplWebkit {
	  protected native void sinkBitlessEventImpl(Element elem, String eventTypeName) /*-{
	    switch(eventTypeName) {
	      case "drag":
	        elem.ondrag           = @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent;
	        break;
	      case "dragend":
	        elem.ondragend        = @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent;
	        break;
	      case "dragenter":
	        elem.ondragenter      = @com.google.gwt.user.client.impl.DOMImplStandard::dispatchDragEvent;
	        break;
	      case "dragleave":
	        elem.ondragleave      = @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent;
	        break;
	      case "dragover":
	        elem.ondragover       = @com.google.gwt.user.client.impl.DOMImplStandard::dispatchDragEvent;
	        break;
	      case "dragstart":
	        elem.ondragstart      = @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent;
	        break;
	      case "drop":
	        elem.ondrop           = @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent;
	        break;
	      case "submit":
	        elem.onsubmit           = @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent;        
	        break;
	      case "canplaythrough":
	      case "ended":
	      case "progress":
	        // First call removeEventListener, so as not to add the same event listener more than once
	        elem.removeEventListener(eventTypeName, @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent, false); 
	        elem.addEventListener(eventTypeName, @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent, false); 
	        break;
	      default:
	        // catch missing cases
	        throw "Trying to sink unknown event type " + eventTypeName;
	    }
	  }-*/;}